package main

import (
	"fmt"
)

// const aaa int= 10
const (
	a = iota
	b = 4 << iota
)

func test(x int) {
	var num int
	fmt.Println(num)
}

type num int
type num2 = int

type student struct {
	name string
	age  int
	sex  string
	//int
}

func main() {

	//fmt.Scan()
	//fmt.Scanln()
	//fmt.Scanf()
	//bufio.NewReader()

	fmt.Println(b)
	//var array [3]int = [3]int{2,3,4}
	//var array2 [3]int
	//var array3 =[...]int{2,3,4}
	//array4 :=[3]int{0:1,2:8}
	//array5 :=[3][3]int{}
	//var nums[]int = array[1:2]
	var n = new(int)
	fmt.Println(*n)
	//r := rune(array)
	//var a int32
	//b := int64(a)
	//c := strconv.Itoa(123)
	var maps = make(map[int]string, 10)
	maps[0] = "123"
	delete(maps, 0)
	s, ok := maps[1]
	fmt.Println(ok, "====================")
	fmt.Println(s)
	var num int = 0
	test(num)

	hanshu := func() {
		fmt.Println("====")
	}
	hanshu()

	//var stu student = student{
	//	name: "aaa",
	//	age: 12,
	//	sex: "nan",
	//}
	var stu2 student
	stu2.name = "bbb"
	//var stu3 =student{"nnn",12,"nn"}
	fmt.Println("================================================")
	var stu4 = &student{"nnn", 12, "nn"}
	fmt.Println((*stu4).name)
	//a2 := recover()
	//err := errors.New("nnn")
	//var temp = 2/0
	//defer recover()

	shu := MaxYueShu(9, 15)
	fmt.Println(shu, "===========================")

	var an animal
	var ddd *dog
	an = ddd
	an.eat()

}

func MaxYueShu(MinNum1 int, MaxNum2 int) int {
	var temp int
	for i := 2; i <= MinNum1; i++ {
		if MinNum1%i == 0 && MaxNum2%i == 0 {
			if temp == 0 {
				temp = i
			}
			if i > temp {
				temp = i
			}
		}
	}
	return temp
}

type animal interface {
	eat()
	sleep()
}
type dog struct {
}

func (ddd dog) eat() {
	fmt.Println("............")
}
func (ddd dog) sleep() {
	fmt.Println("/////")
}
